package com.course.domain.dao;

import com.course.domain.enums.TaskType;
import com.course.domain.model.CoursePlan;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * Created by Justin on 2017/5/12.
 */
public interface CoursePlanDao extends JpaRepository<CoursePlan, Integer> {

    List<CoursePlan> findByCourseIdAndWeekIdx(int courseId, int weekIdx);

    List<CoursePlan> findByCourseIdAndTaskType(int courseId, TaskType type);

    CoursePlan findByCourseIdAndTaskIdAndTaskType(int courseId, int taskId, TaskType taskType);

    List<CoursePlan> findByCourseIdAndWeekIdxAndWeekDay(int courseId, int weekIdx, int weekDay);
}
